//
//  ViewController.m
//  Calculate
//
//  Created by student on 16/2/21.
//  Copyright © 2016年 niit. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UITextField *text1;
@property (weak, nonatomic) IBOutlet UITextField *text2;
@property (weak, nonatomic) IBOutlet UILabel *lableAnswerText;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)Calculate:(UIButton *)sender
{
   int a = self.text1.text.intValue+ self.text2.text.intValue;
    self.lableAnswerText.text = [NSString stringWithFormat:@"%i",a];
    [self.view endEditing:YES];
}
- (IBAction)backTap:(id)sender
{
    [self.text1 resignFirstResponder];
    [self.text2 resignFirstResponder];
}

@end
